package com.atqinke.designpattern.structuraltype.decorator;

/**
 * @BelongsProject: BasicConnection
 * @BelongsPackage: com.atqinke.DesignPattern.structuraltype.decorator
 * @Author: NieHk
 * @CreateTime: 2022-08-26  17:23
 * @Description:
 * @Version: 1.0
 */
public class test {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood food = new FriedRice();

        System.out.println(food.getDesc() + "  " + food.getPrice() + "元");

        System.out.println("===============");

        //在上面的炒饭中加一个鸡蛋
        Egg egg = new Egg(food);
        System.out.println(egg.getDesc() + "  " + egg.getPrice() + "元");


        System.out.println("================");
        //再加一个鸡蛋
        egg = new Egg(egg);
        System.out.println(egg.getDesc() + "  " + egg.getPrice() + "元");

        System.out.println("================");
        egg = new Egg(egg);
        System.out.println(egg.getDesc() + "  " + egg.getPrice() + "元");

        System.out.println("================");
        egg = new Egg(egg);
        System.out.println(egg.getDesc() + "  " + egg.getPrice() + "元");

        System.out.println("================");
        egg = new Egg(egg);
        System.out.println(egg.getDesc() + "  " + egg.getPrice() + "元");
    }
}
